import {Controller, Get, Post} from '@nestjs/common';
import {UserService} from "./user.service";
import {ConfigService} from "@nestjs/config";

@Controller('user')
export class UserController {
    constructor(private userService: UserService,private configServer: ConfigService) {
    }

    @Get()
    getUsers(): any {
        console.log("DB",this.configServer.get("DB"))
        console.log("DB_HOST", this.configServer.get("DB_HOST"))
        return this.userService.getUsers();
    }

    @Post()
    saveUser( user:any): any {
        return this.userService.saveUser(user)
    }
}
